package test;

import java.util.Calendar;
import java.util.Date;

import javax.jms.JMSException;

import entity.News;

import model.NewsModel;

import service.ActiveMQManager;
import service.ActiveMQService;
import service.VnexpressImageReceiver;

@SuppressWarnings("unused")
public class HelloNews extends Thread {
	public static void main(String[] args) {
		HelloNews ht = new HelloNews();
		ht.start();
	}

	public void run() {
		while (true) {
			NewsModel newsModel = new NewsModel();
			News n = newsModel.getFalseComplete();
			try {
				ActiveMQService.sendContentSMS(n.getUrl());
				Thread.currentThread();
				Thread.sleep(5*1000);
			} catch (JMSException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			System.out.println("Send sms ok !");
		}
	}
}